from rest_framework.response import Response

class APIResponse(Response):
    def __init__(self,code=100,msg='成功',data=None,status=None,headers=None, **kwargs):
        data = {'code':code,'msg':msg,'data':data}
        # kwargs 有可能是  {token:asdfad,name:lqz}
        if kwargs:
            data.update(kwargs)
        # 调用父类（Response）的__init__完成初始化
        super().__init__(data=data,status=status,headers=headers)